package com.zhang.zhangapp.bean.shop;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by 罗肖 on 2018/4/11.
 */

public class ShopType implements Parcelable {
    private String no;
    private String code;
    private String name;
    private String icon;
    private int typeId;
    private int pid;
    private List<ShopType> child;


    protected ShopType(Parcel in) {
        no = in.readString();
        code = in.readString();
        name = in.readString();
        icon = in.readString();
        typeId = in.readInt();
        pid = in.readInt();
        child = in.createTypedArrayList(ShopType.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(no);
        dest.writeString(code);
        dest.writeString(name);
        dest.writeString(icon);
        dest.writeInt(typeId);
        dest.writeInt(pid);
        dest.writeTypedList(child);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ShopType> CREATOR = new Creator<ShopType>() {
        @Override
        public ShopType createFromParcel(Parcel in) {
            return new ShopType(in);
        }

        @Override
        public ShopType[] newArray(int size) {
            return new ShopType[size];
        }
    };

    public List<ShopType> getChild() {
        return child;
    }

    public void setChild(List<ShopType> child) {
        this.child = child;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

}
